package com.yjpark.apps.netcalc;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {

	private Context mContext;
	
	private Integer[] mImageIds = {
			R.drawable.images01,
			R.drawable.images02,
			R.drawable.images03,
			R.drawable.images04,
			R.drawable.images05,
			R.drawable.images06,
			R.drawable.images07,
			R.drawable.images08,
			R.drawable.images09,
			R.drawable.images10
	};
	
	public ImageAdapter(Context c) {
		mContext = c;
	}
	

	public int getCount() {
		// TODO Auto-generated method stub
		return mImageIds.length;
	}


	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mImageIds[position];
	}


	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}


	public View getView(int position, View convertViw, ViewGroup parent) {
		// TODO Auto-generated method stub
		ImageView i = new ImageView(mContext);
		i.setImageResource(mImageIds[position]);
		i.setLayoutParams(new Gallery.LayoutParams(150, 100));
		
		return i;
	}

}
